﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;

/// <summary>
/// Summary description for D_User_Login
/// </summary>
namespace Bestlife.ERP.DataAccess
{
    public class D_User_Login
    {
        public D_User_Login()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static Boolean userlog(string User_Name,string Password)
        {
            Boolean name = false;
            SqlConnection conn_new = new SqlConnection();
            try
            {
                String connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString;
                Bestlife.ERP.DataAccess.clsCon.connect(connStr);
                String Ssql = "SELECT [Use_Name],[Pas_Word]  FROM [Tbl_User] where Use_Name='"+User_Name+"' and Pas_Word='" +Password+ "' ";
                //SqlDataReader ldr = Bestlife.ERP.DataAccess.clsCon.ReadTable(Ssql);
                SqlDataReader rdR;
                rdR = clsCon.ReadTable(Ssql);
                if (rdR.Read())
                {
                    name=true;
                }
                else
                {
                    name=false;
                }
                rdR.Close();
                clsCon.conn_new.Close();
            }
            catch (Exception)
            {
                // Console.WriteLine(exx);
            }
            return name;
        }
    }
}